<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img
        :src="bannerImg"
        alt=""
        class="banner-img"
      />
      <div class="banner-info">
        <div class="banner-title">{{this.sightName}}</div>
        <div class="banner-nummer">10</div>
      </div>
    </div>
    <fade>
    <common-gallary :imgs="gallaryImgs" v-show="showGallary" @close="handleGallartClose" v-if="gallaryImgs.length"></common-gallary>
    </fade>
  </div>

</template>

<script>
import CommonGallary from "common/gallary/Gallary";
import Fade from 'common/fade/fade'
export default {
  name: "DetailBanner",
  components: {
    CommonGallary,
    Fade
    
  },
  props:{
    bannerImg:String,
    sightName:String,
    gallaryImgs:Array
  },
  data(){
    return {
      showGallary:false
    }
  },
  methods:{
    handleBannerClick(){
      this.showGallary = true
    },
    handleGallartClose(){
      this.showGallary = false
    }
  }
  
};
</script>

<style lang="stylus" scoped>
.banner {
  overflow: hidden;
  height: 0;
  padding-bottom: 50%;
  position: relative;

  .banner-img {
    width: 100%;
    // float: left
  }

  .banner-info {
    position: absolute;
    display: flex;
    bottom: 0;
    left: 0;
    right: 0;
    line-height: 0.6rem;
    color: #fff;
    background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));

    .banner-title {
      font-size: 0.32rem;
      padding: 0 0.2rem;
      flex: 1;
    }

    .banner-nummer {
      margin-top: 0.28rem;
      padding: 0 0.4rem;
      height: 0.3rem;
      line-height: 0.3rem;
      border-radius: 0.2rem;
      background: #ccc;
      font-size: 0.24rem;
    }
  }
}
</style>